package com.shujia.dim

import org.apache.spark.internal.Logging
import org.apache.spark.sql.{SaveMode, SparkSession}

object ScenicBoundaryOdsToDim extends Logging {
  def main(args: Array[String]): Unit = {

    val spark: SparkSession = SparkSession
      .builder()
      .appName("ScenicBoundaryOdsToDim")
      .config("spark.sql.shuffle.partitions", "1")
      .enableHiveSupport() //使用hive的元数据
      .getOrCreate()

    /**
     * 将ods层的景区配置表导入到dim层
     *
     */

    spark
      .table("ods.ods_scenic_boundary")
      .write
      .format("csv")
      .option("sep", "\t")
      .mode(SaveMode.Overwrite)
      .save("/daas/motl/dim/dim_scenic_boundary")

    /**
     * spark-submit --class com.shujia.dim.ScenicBoundaryOdsToDim --master yarn-client dim-1.0-SNAPSHOT.jar
     *
     */

  }
}
